FROM golang:1.16.6-buster AS build
WORKDIR /go/src/app
COPY . .
RUN go build --ldflags '-linkmode external -extldflags "-static"' .

FROM scratch
COPY --from=build /go/src/app/hello-go ./

CMD ["./hello-go"]
EXPOSE 8000